package net.cloudcodex.client.home.view;

import java.util.Date;
import java.util.List;

import net.cloudcodex.client.home.view.HomeView.Message;
import net.cloudcodex.client.home.view.panel.character.HomeCharacterPanel;

import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.inject.Inject;

/**
 * 
 * 
 * @author ADaroussin
 */
public class HomeCharacterViewImpl extends FlowPanel implements
		HomeCharacterView {

	private final Message message;


	private final HomeCharacterPanel homeCharacterPanel = new HomeCharacterPanel();

	@Inject
	public HomeCharacterViewImpl(Message message) {
		this.message = message;
		homeCharacterPanel.setMessage(message);
		this.add(homeCharacterPanel);
	}

	@Override
	public void addCharacter(long id, String icon, String name) {
		homeCharacterPanel.addCharacter(id, icon, name);
	}

	@Override
	public void addCampaignInfos(String name, String game, Date creationDate,
			String gameMasterNickname) {
		homeCharacterPanel.addCampaignInfos(name,game,creationDate,gameMasterNickname);
		
	}

	@Override
	public void addNotification(String message, Date date) {
		homeCharacterPanel.addNotification(message, date);
		}

	@Override
	public void addStoryBoardResponse(List<String> charactersResponder) {
		homeCharacterPanel.addStoryBoardResponse( charactersResponder);
	}

	@Override
	public HasClickHandlers getCharacterAvatar() {
		
		return homeCharacterPanel.getCharacterAvatar();
	}

	@Override
	public void initView() {
		homeCharacterPanel.initComponent();
	}

	@Override
	public HasClickHandlers getSeeMoreAnchor() {
		return homeCharacterPanel.getSeeMoreAnchor();
	}
}
